import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer st;

    public static String next() throws IOException {
        while(st==null|| !st.hasMoreTokens()){
            st=new StringTokenizer(br.readLine());
        }

        return st.nextToken();
    }

    public static String nextLine() throws IOException{
        return br.readLine();
    }

    public static boolean hasNext() throws IOException {
        return br.ready();
    }

    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static void main(String[] args) throws IOException {
        int k=nextInt();
        int t=nextInt();
        while(t-->0){
            long count=1;
            int target=nextInt();
            long start=2+k;
            long right=start+k;
            while(target>=start){
                right=start+k;
                while (gcd(right,start)!=1){
                    right++;
                }
                start=right+1;
                count++;
            }

            System.out.println(count);
        }

    }


    private static long gcd(long a,long b){
        while(b!=0){
            long tmp=b;
            b=a%b;
            a=tmp;
        }

        return a;
    }


}


 class Main1 {
    public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer st;

    public static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }

        return st.nextToken();
    }

    public static String nextLine() throws IOException {
        return br.readLine();
    }

    public static boolean hasNext() throws IOException {
        return br.ready();
    }

    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static int mod=(int)1e9+7;

     public static void main(String[] args) throws IOException {

         int n=nextInt();
         int k=n;

         long count2=0;
         while (k-->0){
             String s=nextLine();

            if (s.charAt(0)=='D') {
                 count2++;
             }

         }

         long num=1;

         for(int i=2;i<=n;i++){
             num=num*i%mod;
         }

         long m=fpow(2,count2);

         long invm=fpow(m,mod-2);


         System.out.println(num * invm % mod);


     }


     public static long fpow(long a,long b){
        long ret=1;
        while(b>0){
            if((b&1)==1){
                ret=ret*a%mod;
            }
            a=a*a%mod;
            b>>=1;

        }

        return ret;
     }
}